//
//  PersonChannelContent.m
//  TestApplication
//
//  Created by Hanlingyu on 16/09/16
//  Copyright (c) ltq. All rights reserved.
//

#import "PersonChannelContent.h"
#import "PersonChannelPosts.h"
#import "PersonChannelJoin.h"

@implementation PersonChannelContent

- (void)setValue:(id)value forKey:(NSString *)key {
    [super setValue:value forKey:key];
    if ([key isEqualToString:@"join"]) {
        _join = [PersonChannelJoin modelWithDic:value];
    } else if ([key isEqualToString:@"posts"]) {
        NSMutableArray *array = [NSMutableArray array];
        for (NSDictionary *dic in value) {
            PersonChannelPosts *post = [PersonChannelPosts modelWithDic:dic];
            [array addObject:post];
        }
        _posts = array;
    } 
}


+ (NSDictionary *)objectClassInArray{
    return @{@"posts" : [PersonChannelPosts class]};
}

@end
